Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 17: Mapping Textures

../ch17/17fig14b.gif
Figure 17.14b

A swirling whirlpool created using a movie texture.

17fig14b.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
    children [
    # Ground
        Shape {
            appearance Appearance {
                material Material {
                    diffuseColor 0.0 0.7 0.0
                }
            }
            geometry Box { size 10.0 0.01 10.0 }
        },
    # Well wall
        Shape {
            appearance Appearance {
                material Material { }
                texture ImageTexture {
                    url "wellwall.jpg"
                }
            }
            geometry Extrusion {
                creaseAngle 1.57
                beginCap FALSE
                endCap   FALSE
                crossSection [
                # upside-down U-shape
                     0.4  0.0,
                     0.4 -0.7,
                    -0.4 -0.7,
                    -0.4  0.0,
                ]
                spine [
                # Circle
                     2.00 0.0  0.00,   1.85 0.0 0.77,
                     1.41 0.0  1.41,   0.77 0.0 1.85,
                     0.00 0.0  2.00,  -0.77 0.0 1.85,
                    -1.41 0.0  1.41,  -1.85 0.0 0.77,
                    -2.00 0.0  0.00,  -1.85 0.0 -0.77,
                    -1.41 0.0 -1.41,  -0.77 0.0 -1.85,
                     0.00 0.0 -2.00,   0.77 0.0 -1.85,
                     1.41 0.0 -1.41,   1.85 0.0 -0.77,
                     2.00 0.0  0.00,
                ]
            }
        },
    # Well water
        Shape {
            appearance Appearance {
                # No material, use emissive texturing
                texture MovieTexture {
                    url "wrlpool.mpg"
                    loop TRUE
                }
            }
            geometry IndexedFaceSet {
                solid FALSE
                coord Coordinate {
                    point [
                    # Circle
                         2.00 0.6  0.00,   1.85 0.6 0.67,
                         1.41 0.6  1.41,   0.67 0.6 1.85,
                         0.00 0.6  2.00,  -0.67 0.6 1.85,
                        -1.41 0.6  1.41,  -1.85 0.6 0.67,
                        -2.00 0.6  0.00,  -1.85 0.6 -0.67,
                        -1.41 0.6 -1.41,  -0.67 0.6 -1.85,
                         0.00 0.6 -2.00,   0.67 0.6 -1.85,
                         1.41 0.6 -1.41,   1.85 0.6 -0.67,
                         2.00 0.6  0.00,
                    ]
                }
                coordIndex [
                    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
                    11, 12, 13, 14, 15, 16
                ]
            }
        }
    ]
}